package com.schoolhelper;

import android.app.Application;
import android.content.Context;
import android.widget.Toast;

import com.hyphenate.EMCallBack;
import com.hyphenate.chat.EMClient;
import com.hyphenate.chat.EMOptions;
import com.hyphenate.easeui.EaseIM;
import com.schoolhelper.model.Model;

public class SHApplication extends Application {

    private static Context mContext;

    @Override
    public void onCreate() {
        super.onCreate();

        // 初始化EaseIM
        EMOptions options = new EMOptions();
        options.setAcceptInvitationAlways(false);// 设置需要同意后才能接受邀请
        options.setAutoAcceptGroupInvitation(false);// 设置需要同意后才能接受群邀请

        EaseIM.getInstance().init(this, options);

        // 初始化数据模型层类
        Model.getInstance().init(this);

        // 初始化全局上下文对象
        mContext = this;

    }

    // 获取全局上下文对象
    public static Context getGlobalApplication(){
        return mContext;
    }
}
